package com.heima.wemedia.controller.v1;


import com.heima.model.wemedia.dtos.WmManuallyReviewDto;
import com.heima.model.wemedia.dtos.WmWeMediaDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmWeMediaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/news")
public class WeMediaController {

@Autowired
private WmWeMediaService weMediaService;
    /**
     * 自媒体审核查询
     * @return
     */
    @PostMapping("list_vo")
    public ResponseResult findAll(@RequestBody WmWeMediaDto adWeMediaDto){
      return weMediaService.findAll(adWeMediaDto);
    }

    /**
     * 查询文章详情
     * @return
     */
    @GetMapping("/one_vo/{id}")
    public ResponseResult selectById(@PathVariable("id") Long id){
        return weMediaService.selectById(id);
    }

    /**
     * 人工审核驳回
     * @return
     */
    @PostMapping("/auth_fail")
    public ResponseResult auditReject(@RequestBody WmManuallyReviewDto dto){
        return weMediaService.auditReject(dto);
    }

    /**
     * 人工审核成功
     * @return
     */
    @PostMapping("/auth_pass")
    public ResponseResult auditSucceed(@RequestBody WmManuallyReviewDto dto){
        return weMediaService.auditSucceed(dto);
    }

}
